#!/usr/bin/env python
"""
# -*- coding: utf-8 -*-
# @Time    : 2020/9/22 11:24
# @Author  : AshJo
# @Desc    : 队列和栈
# @Filename: queue_stack.py
# @Version : v1.0
"""


class Data:

    def __init__(self):
        self.l = []

    def put(self, value):
        self.l.append(value)


class Queue(Data):

    def get(self):
        return self.l.pop(0)


class Stack(Data):

    def get(self):
        return self.l.pop()


q1 = Queue()
q2 = Queue()
s1 = Stack()
s2 = Stack()

# q1.put(1)
# q1.put(2)
# q1.put(3)
# q2.put(4)
# q2.put(5)
# q2.put(6)
# for i in range(3):
#     print(q1.get())
# for i in range(3):
#     print(q2.get())

s1.put(1)
s1.put(2)
s1.put(3)
s2.put(4)
s2.put(5)
s2.put(6)
for i in range(3):
    print(s1.get())
for i in range(3):
    print(s2.get())
